package com.learn.springboot.mapper.master;

import com.learn.springboot.bean.User;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Options;

/**
 * @author dyz
 * @version 1.0
 * @create 2019-09-22 17:27
 */
@Mapper
public interface MasterUserMapper {

    @Insert("INSERT INTO user (name, age) VALUES(#{name}, #{age})")
    @Options(useGeneratedKeys = true, keyProperty = "id")
    void insert(User user);

    User findByName(String name);
}
